package com.qianxx.component.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.qianxx.component.R;
import com.qianxx.component.activity.base.BaseActivity;
import com.qianxx.component.activity.progress.arc_progress.ArcProgressActivity;
import com.qianxx.component.activity.progress.circular_progress.CircleProgressActivity;
import com.qianxx.component.activity.progress.circular_progress_button.CircularProgressButtonActivity;
import com.qianxx.component.activity.progress.number_progress_bar.NumberProgressBarActivity;
import com.qianxx.component.activity.progress.rotate_image.RotateImageActivity;
import com.qianxx.component.activity.progress.seek_bar.SeekBarActivity;
import com.qianxx.component.activity.progress.two_ball_rotation_progress_bar.TwoBallRotationProgressBarActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnItemClick;

public class ProgressActivity extends BaseActivity {
    @BindView(R.id.lv)
    ListView lv;
    private ArrayAdapter adapter;
    private String[] listItems = {"SeekBar", "CircleProgress","ArcProgress",
            "TwoBallRotationProgressBar", "RotateImageView",
            "CircularProgressButton", "NumberProgressBar"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_progress);
        ButterKnife.bind(this);

        adapter = new ArrayAdapter(this, R.layout.item, listItems);
        lv.setAdapter(adapter);
    }

    @OnItemClick(R.id.lv)
    void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        Intent intent = null;
        switch (arg2) {
            case 0:
                intent = new Intent(ProgressActivity.this, SeekBarActivity.class);
                break;
            case 1:
                intent = new Intent(ProgressActivity.this, CircleProgressActivity.class);
                break;
            case 2:
                intent = new Intent(ProgressActivity.this, ArcProgressActivity.class);
                break;
            case 3:
                intent = new Intent(ProgressActivity.this, TwoBallRotationProgressBarActivity.class);
                break;
            case 4:
                intent = new Intent(ProgressActivity.this, RotateImageActivity.class);
                break;
            case 5:
                intent = new Intent(ProgressActivity.this, CircularProgressButtonActivity.class);
                break;
            case 6:
                intent = new Intent(ProgressActivity.this, NumberProgressBarActivity.class);
                break;
            default:
                break;
        }
        startActivity(intent);
    }
}
